package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @description AppUser 用户信息表
 * @author mark
 * @Date 2025-07-23 09:09:05
 */

@Setter
@Getter
@EqualsAndHashCode
@ToString
@TableName("app_user")
@Schema(name = "AppUser", description = "App用户表")
public class AppUser  {


    /**
     * 主键ID
     */
    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 昵称(注册成功即分配自动序列号)
     */
    @Schema(description = "昵称")
    @TableField("nickname")
    private String nickname;

    /**
     * 用户名或手机号
     */
    @Schema(description = "用户名或手机号")
    @TableField("username")
    private String username;

    /**
     * 密码(未注册时可以为空)
     */
    @Schema(description = "密码")
    @TableField("password")
    @JsonIgnore
    private String password;

    /**
     * 手机号
     */
    @Schema(description = "手机号")
    @TableField("mobile_phone")
    private String mobilePhone;

    /**
     * 真实姓名
     */
    @Schema(description = "真实姓名")
    @TableField("realname")
    private String realname;

    /**
     * 性别(1男2女;0未知)
     */
    @Schema(description = "性别")
    @TableField("sex")
    private Integer sex;

    /**
     * 头像
     */
    @Schema(description = "头像")
    @TableField("avatar")
    private String avatar;

    /**
     * 个人简介
     */
    @Schema(description = "个人简介")
    @TableField("personal_profile")
    private String personalProfile;

    /**
     * 账号状态；1正常，0停用
     */
    @Schema(description = "账号状态")
    @TableField("account_status")
    private Integer accountStatus;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonIgnore
    private LocalDateTime updatedTime;

    /**
     * 最后登录IP
     */
    @Schema(description = "最后登录IP")
    @TableField("login_ip")
    private String loginIp;

    /**
     * 最后登录时间
     */
    @Schema(description = "最后登录时间")
    @TableField("login_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime loginTime;

    /**
     * 注销时间
     */
    @Schema(description = "注销时间")
    @TableField("cancel_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime cancelTime;

    /**
     * 删除(0不删除1已删除)
     */
    @Schema(description = "删除标志")
    @TableField("del")
    private Integer del;

    /**
     * 角色ID
     */
    @Schema(description = "角色ID")
    @TableField("role_id")
    private Integer roleId;

    /**
     * 系统标识有多个时候按照逗号拼接
     */
    @Schema(description = "系统标识")
    @TableField("sys_type")
    private Integer sysType;

    /**
     * 是否是外部系统导入（可以空表示不是;外部导入用户注册成功后变为0;1是,注册成功后变成2）
     */
    @Schema(description = "外部系统导入标志")
    @TableField("out_online_flag")
    private Integer outOnlineFlag;

}
